import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
// import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
import prettierConfig from '@vue/eslint-config-prettier'
export default [
  {
    name: 'app/files-to-lint',
    files: ['**/*.{ts,mts,tsx,vue}'],
  },

  {
    name: 'app/files-to-ignore',
    ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
  },

  ...pluginVue.configs['flat/essential'],
  ...vueTsEslintConfig(),
  // skipFormatting,
  prettierConfig,
  {
    rules: {
      'vue/component-name-in-template-casing': [
        'error',
        'PascalCase',
        {
          // 可选配置项
          ignores: [], // 忽略检查的组件名（如第三方组件）
          registeredComponentsOnly: true,
        },
      ],

      // 建议补充其他组件命名相关规则
      'vue/component-options-name-casing': ['error', 'PascalCase'],
    },
  },
  {
    files: ['*.vue'],
    rules: {
      'filename-rules/match': ['error', '^[A-Z][a-zA-Z0-9]+\\.vue$'],
    },
  },
]
